/*
	op: 
		00/01 	= Left shift
		10		= Right shift,0 Filled
		11		= Right shift,with symbol extent
*/

module barrelShifterF
(
    input   wire    [63:00]          data_in,
    input   wire    [01:00]          op,
    input   wire    [05:00]          shamt,
    output  wire    [63:00]          data_out
);
    wire    [63:00]     shift0;
    wire    [63:00]     shift1;
    wire    [63:00]     shift2;
    assign shift0 = (
        (shamt[0])?
            (op[1]?{{1{data_in[63] & op[0]}},data_in[63:1]} : {data_in[62:00],1'b0}):
            (data_in));
    assign shift1 = (
        (shamt[1])?
            (op[1]?{{2{data_in[63] & op[0]}},shift0[63:2]} : {shift0[61:00],2'b0}):
            (shift0)
    );

    assign shift2 = (
        (shamt[2])?
            (op[1]?{{4{data_in[63] & op[0]}},shift1[63:4]} : {shift1[59:00],4'b0}):
            (shift1)
    );

    assign data_out = shift2;

endmodule

